<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>发布公告</title>
    <style>
        textarea{
            position: absolute;
            top: 15%;
            left: 5%;
            width: 50%;
            height: 20%;
        }
        button{
            position: absolute;
            top: 30%;
            left: 60%;
        }
    </style>
    <script>
        function SwapTxt(){
            var txt = document.getElementById("textarea").value;  //获取文本框里的值
            console.log(txt);
            localStorage. setItem( 'key', txt);
        }

    </script>
</head>
<body>
<div>
    <form action="@{noticeinsert}" method="post">
        <tr>
            <td>管理员ID</td>
        </tr>
        <tr>
            <th>管理员姓名</th>
        </tr>
        <textarea id="textarea" onchange="SwapTxt" rows="15" cols="40" style="overflow:auto"></textarea>
        <tr>
            <button type="submit">发布</button>
        </tr>
    </form>
</div>
</body>
</html>